﻿
namespace Marmat.Forms.Views
{
    namespace Grid
    {
        public class CellMergeEventArgs : GridEventArgs
        {
            internal DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs info;

            internal CellMergeEventArgs(BaseGrid GridControl, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs info) : base(GridControl)
            {
                this.info = info;
            }

            /// <summary>
            /// 获取正在合并的第一个单元格的值。
            /// </summary>
            /// <returns></returns>
            public object CellValue1
            {
                get
                {
                    return this.info.CellValue1;
                }
            }

            /// <summary>
            /// 获取正在合并的第二个单元格的值。
            /// </summary>
            /// <returns></returns>
            public object CellValue2
            {
                get
                {
                    return this.info.CellValue2;
                }
            }

            /// <summary>
            /// 获取包含要合并的值的列。
            /// </summary>
            /// <returns></returns>
            public Column Column
            {
                get
                {
                    return (Column)this.info.Column.Tag;
                }
            }

            /// <summary>
            /// 获取或设置是否处理单元格合并操作，因此不存在缺省值
            /// 处理是必需的。
            /// </summary>
            /// <returns></returns>
            public bool Handled
            {
                get
                {
                    return this.info.Handled;
                }

                set
                {
                    this.info.Handled = value;
                }
            }

            /// <summary>
            /// 获取或设置是否应合并两个单元格。
            /// </summary>
            /// <returns></returns>
            public bool Merge
            {
                get
                {
                    return this.info.Merge;
                }

                set
                {
                    this.info.Merge = value;
                }
            }

            /// <summary>
            /// 获取包含要处理合并的两个单元格中的第一个单元格的行号
            /// </summary>
            /// <returns></returns>
            public int RowHandle1
            {
                get
                {
                    return this.info.RowHandle1;
                }
            }
            /// <summary>
            /// 获取包含要处理合并的两个单元格中的第二个单元格的行号
            /// </summary>
            /// <returns></returns>
            public int RowHandle2
            {
                get
                {
                    return this.info.RowHandle2;
                }
            }
        }
    }
}